#ifndef SKYLINE_H
#define SKYLINE_H

#include <gtkmm.h>
#include <vector>
#include "listview.h"

class Skyline
{
	public:

	Skyline(int w, int h, const Glib::RefPtr<Gtk::ListStore>& rectangles);
	int solve();

	protected:

	struct rect{
		int w;
		int h;
		int x;
		int y;
	};

	ModelColumns m_Columns;

	int width, height;
	Glib::RefPtr<Gtk::ListStore> model;
	friend bool comparew(const Skyline::rect& x, const Skyline::rect& y);

	void save(std::vector<struct rect> &rlist);

	int getlowest(std::vector<int>& sky);
	std::vector<struct rect> packleftmost(std::vector<struct rect>rls,std::vector<int>sky,int *hh,std::vector<struct rect>&rls);
	std::vector<struct rect> packtotall(std::vector<struct rect>rls,std::vector<int>sky,int * hh);
	std::vector<struct rect> packtoshort(std::vector<struct rect>rls,std::vector<int>sky,int *hh);
};

bool comparew(const Skyline::rect& x, const Skyline::rect& y);



#endif
